package messages;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.io.*;

public class LogInMessage implements Message, Serializable{


	/**
	 * 
	 */
	private static final long serialVersionUID = 6165812813082998201L;
	String user;
	String password;
	String avatar;
	String msg;
	String time;
	int msgLength;
	DateFormat dateFormat;
	Calendar cal;
	
	public LogInMessage(String user, String password, String avatar, String msg) {
		dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		cal = Calendar.getInstance();
		time = (dateFormat.format(cal.getTime()))+"";
		this.msgLength = 65;
		
		this.user = user;
		this.password = password;
		this.avatar = avatar;
		this.msg = msg;
	}
	
	public String getUser(){
		return user;
	}
	
	public String getPassword(){
		return password;
	}
	
	public String getAvatar(){
		return avatar;
	}
	
	public String getMsg(){
		return msg;
	}
	
	public String getTime(){
		return time;
	}
	
	public int getMsgLength(){
		return msgLength;
	}
	
	public String getType(){
		return Message.logInKey;
	}

	@Override
	public String getChatRoom() {
		return null;
	}

}
